package com.ruoyi.business.controller.app;

import com.ruoyi.business.service.IWsdCanteensService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.vo.WsdCanteensVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 饭堂信息Controller  小程序
 * 
 * @author ruoyi
 * @date 2024-04-15
 */
@RestController
@RequestMapping("wx_canteens")
public class  WxAppWsdCanteensController extends BaseController {

    @Autowired
    private IWsdCanteensService wsdCanteensService;

    /**
     * 获取饭堂图片
     */
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo() {
       //获取学校id
        SysUser user = getLoginUser().getUser();
        Long schoolId = user.getSchoolId();
        WsdCanteensVO wsdCanteensVO = wsdCanteensService.selectWsdCanteensBySchoolId(schoolId);
        return success(wsdCanteensVO);
    }
}
